//
//  SocketParsable.h
//  Socket.IO-Client
//
//  Created by alanwang.dev on 16/8/8.
//  Copyright © 2016年 com.alanwang.dev. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SocketIOClientSpec.h"
#import "Either.h"

@protocol SocketParsableProtocol <NSObject>

- (void)parseBinaryData:(NSData *)data;
- (void)parseSocketMessage:(NSString *)message;

@end

@interface SocketParsable : SocketIOClientSpec <SocketParsableProtocol>
/// Parses a messsage from the engine. Returning either a string error or a complete SocketPacket
// 返回值类型为 Either<String, SocketPacket>
- (Either *)parseString:(NSString *)message;

// Parses data for events
// 返回值类型为 Either<String, SocketPacket>
//- (Either *)parseData:(NSString *)data;

// Parses messages recieved
// 已定义
//- (void)parseSocketMessage:(NSString *)message;
//- (void)parseBinaryData:(NSData *)data;

@end
